﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 卷书.Utils;

namespace 卷书
{
    public static class Global
    {
        public static List<Library> Libraries;//当前项目 对应着几个 库
        public static string SqlitePath = "data.sqlite";

        private static StringBuilder _StatusMessage = new StringBuilder("状态栏");

        public static readonly char[] BANFILECHAR = { '\\', '#', '%', '&', '*', '|', ':', '"', '<', '>', '?', '/', '.' };

        public const string GITEE_URL = "https://gitee.com/gitee-chao/volume-book";


        public static StringBuilder StatusMessage
        {
            get
            {
                return _StatusMessage;
            }
            set
            {
                _StatusMessage = value;
                MainWindow main = FileHelper.GetWindowByName("MainWindow") as MainWindow;
                main.StatusTextBlock.Text = value.ToString();
            }
        }

        public static void Init()
        {
            Libraries = new List<Library>();
            if (File.Exists(Settings.CurrentProject))
            {
                Libraries = new LibraryStream(Settings.CurrentProject).Read();
            }
        }

    }
}
